<div class="g12 nodrop" style="margin-bottom: 43px;">

    <h1> <? if (isset($_GET['subcolumnid'])) {echo $columnname[0]['name']; } else echo 'Rubrike članka' ?> </h1>

    <p style="line-height: 13px;">

        <? if (isset($_GET['subcolumnid'])) {echo 'Ažuriranje rubrike'; } else echo 'Nova rubrika' ?>        

    </p>

    <!--FORM-->    
    <div style="width: 100%;">

        <div id="srvrserror-3"></div>

        <button id="dialog_confirm" style="display: none;">Confirm Dialog (confirm)</button>

        <form action="javascript:" method="post" autocomplete="off" data-confirm-send="false">

            <fieldset>

                <section><label for="input">Rubrika</label>
                    <div>
                        <select name="column" id="column" style="color: #555555; line-height: 16px; padding: 3px 0 0 3px; width: 17em;">
                        <option value="0">-- Molim odaberite</option> 
                            <?
                                foreach($columns as $column){

                                    if($column['name']!="tmp"){

                                    ?><option value="<?=$column['id'];?>" <?  if (isset($columnname[0]['name'])){if(($column['id']==$columnname[0]['column_id'])){ echo 'selected=selected';}} ?>><?=$column['name'];?></option><?

                                    }
                                }
                            ?>
                        </select>
                    </div>
                </section>

                <section><label for="input">NAZIV</label>
                    <div><input type="text" id="name" name="name" required value="<? if (isset($columnname[0]['name'])) echo $columnname[0]['name']; ?>"></div>
                </section>

                <section>
                    <button class="submit small" onclick="return false;"><? if (isset($columnname[0]['name'])) {echo 'Ažuriraj rubriku'; }else echo 'Kreiraj rubriku'; ?></button></div>
                </section> 

            </fieldset>

        </form>

    </div>

</div>

<!-- VARIABLES TO edit_new.js -->
<script type="text/javascript">
    var appmode;
    var subcolumnid;
    <?  if (isset($_GET['subcolumnid'])){ ?> 
        appmode = 'edit';
        subcolumnid = '<?=$_GET['subcolumnid']?>';

        <?}else{?> 
        appmode = 'insert'; 
        subcolumnid = -1;
        <? } ?>
</script>